#! /bin/bash
case $1 in "start"){
for i in hadoop100.localdomain hadoop101.localdomain hadoop102.localdomain 
do 
echo " --------启动 $i Kafka-------" 
ssh $i "source /etc/profile;/opt/module/kafka/bin/kafka-server-start.sh -daemon /opt/module/kafka/config/server.properties " 
done };; 
"stop"){
for i in hadoop100.localdomain hadoop101.localdomain hadoop102.localdomain 
do 
echo " --------停止 $i Kafka-------" 
ssh $i "source /etc/profile;/opt/module/kafka/bin/kafka-server-stop.sh stop" 
done };; 
esac
